<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 100px;
            height: 100px;
            background: black;
            margin: 10px;
        }
    </style>
</head>

<body>
    <button onclick="bk()">变宽</button>
    <button onclick="bg()">变高</button>
    <button onclick="bs()">变色</button>
    <button onclick="yc()">隐藏</button>
    <button onclick="cz()">重置</button>
    <div class="box">

    </div>
</body>

</html>
<script>
    var box = document.querySelector('.box')
    console.log(box);
    function bk() {
        box.style.width = '200px'
    }
    function bg() {
        box.style.height = '200px'
    }
    function bs() {
        box.style.background = 'orange'
    }
    function yc() {
        box.style.display = 'none'
    }
    function cz() {
        box.style.width = '100px'
        box.style.height = '100px'
        box.style.background = 'black'
        box.style.display = 'block'
    }
</script>